#pragma once

#include "stdafx.h"
#include <vector>

#ifdef DLLFUN_EX
   #define DLLFUN  __declspec(dllexport)   // export DLL information
#else
   #define DLLFUN  __declspec(dllimport)   // import DLL information
#endif 

using namespace std;

namespace bdc{

	namespace service{

		typedef struct MemoryInfo{
			LONG64 memoryId;
			LONG64 userId;
			LONG64 recordId;
			LONG64 scheduleDate;
			LONG64 handleDate;
			int consumptionTime;
			int score;
		}MemoryInfo;

		typedef struct RecordInfo{
			LONG64 recordId;
			LONG64 userId;
			LPCSTR memory;
			LPCSTR description;
			LPCSTR tag;
			LPCSTR tagId;
			LONG64 addTime;
		}RecordInfo;

		typedef struct TagInfo{
			LONG64 tagId;
			LONG64 userId;
			LPCSTR tag;
			LONG64 amount;
		}TagInfo;

		class DLLFUN ServiceInvoker
		{
		private:
			char* pServiceUrl;

		public:
			ServiceInvoker(void);
			~ServiceInvoker(void);

		public:
			BOOL getTagList(vector<TagInfo*>&);
			BOOL getTagRecordList(LONG64, LONG64, LONG64, vector<RecordInfo*>&);

			BOOL getTodayRecordList(vector<RecordInfo*>&);
			BOOL upateMemory(LONG64, int);

			BOOL addRecord(LPCWSTR, LPCWSTR, LPCWSTR);
			BOOL updateRecord(LONG64, LPCWSTR, LPCWSTR, LPCWSTR);
			BOOL delRecord(LONG64);
			
			LONG64 addTag(LPCWSTR);
			BOOL updateTag(LONG64, LPCWSTR);
			BOOL delTag(LONG64);

			LONG64 login(LPCWSTR, LPCWSTR);
		};
	}
}


